import { TableColumnObject } from 'amis/lib/renderers/Table'
import upmsAuthorityAdminService from '@/core/upms/generated/service/admin/upmsAuthorityAdminService'
import serverColumnUtils, { ServerColumnUtilsProps } from '@/components/amis/ServerColumnUtils/serverColumnUtils'

class UpmsAuthorityIdColumnUtils {
	getSchema = (parmas?: Partial<ServerColumnUtilsProps>): TableColumnObject => {
		return serverColumnUtils.getSchema(
			Object.assign(
				{
					name: 'upmsMenuId',
					label: '菜单',
					valueField: 'id',
					labelField: 'title',
					getByIdsWithDebounce: upmsAuthorityAdminService.getByIdsWithDebounce,
				},
				parmas,
			),
		)
	}
}

export default new UpmsAuthorityIdColumnUtils()
